package com.aboo.rocketmq.action;

import com.aboo.frame.vo.ReturnVO;
import com.aboo.rocketmq.service.RocketMqService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/rocketmq")
public class RocketMqAction {

    @Resource
    private RocketMqService rocketMqService;

    @RequestMapping("/sendMsg")
    public ReturnVO<Object> sendMsg(String msg) {
        ReturnVO<Object> rv = new ReturnVO<>();
        boolean flag = rocketMqService.sendMq(msg);

        rv.setData(msg);
        return rv;
    }

}
